<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorator="layouts/layout" th:with="header='编辑工厂', subtext='编辑指定工厂数据'">

<head>
	<title>编辑工厂</title>
</head>
<body>
	<th:block layout:fragment="content">
		<div class="box">
			<div class="box-body">
				<form id="plantForm" name="plantForm" th:object="${m}" th:action="@{|${baseUrl}/save${m.id==null?'':'/' + m.id}|}" method="post" class="form-horizontal" novalidate="novalidate">
					<input id="id" type="hidden" name="id" th:field="*{id}" />
					<input id="version" type="hidden" name="version" th:field="*{version}" />
					<div class="row line">
						<div class="col-lg-6">
							<h3 class="page-header">基本设置</h3>
						</div>
					</div>
					        <div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 required">工厂编号</label>
										<div class="col-sm-8 form-control-static">
											 <input id="no" name="no" th:value="*{no}" maxlength="4"
												class="form-control required" th:readonly="${not m.new}"/>
										</div>
									</div>
								</div>
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">SAP工厂编号</label>
										<div class="col-sm-8 form-control-static">
											<input id="sapPlantNo" name="sapPlantNo" th:value="*{sapPlantNo}" maxlength="10"
											class="form-control" />
										</div>
									</div>
								</div>
						    </div>
							<div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">SAP公司代码</label>
										<div class="col-sm-8 form-control-static">
											<input id="sapCompanyNo" name="sapCompanyNo" th:value="*{sapCompanyNo}" maxlength="20"
											class="form-control" />
										</div>
									</div>
								</div>
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">邓白氏码</label>
										<div class="col-sm-8 form-control-static">
											<input id="plantDunsCode" name="plantDunsCode" th:value="*{plantDunsCode}" maxlength="9"
											class="form-control number" />
										</div>
									</div>
								</div>
						    </div>
						    <div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 required">中文名称</label>
										<div class="col-sm-8 form-control-static">
											<input id="name" name="name" th:value="*{name}" maxlength="100"
										class="form-control required" />
										</div>
									</div>
								</div>
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">中文简称</label>
										<div class="col-sm-8 form-control-static">
											<input id="nameCS" name="nameCS" th:value="*{nameCS}" maxlength="100"
											class="form-control" />
										</div>
									</div>
								</div>
						    </div>
						     <div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">英文名称</label>
										<div class="col-sm-8 form-control-static">
											<input id="nameE" name="nameE" th:value="*{nameE}" maxlength="100"
											class="form-control" />
										</div>
									</div>
								</div>
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">英文简称</label>
										<div class="col-sm-8 form-control-static">
											<input id="nameES" name="nameES" th:value="*{nameES}" maxlength="100"
											class="form-control" />
										</div>
									</div>
								</div>
						    </div>
						    <div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<label class="control-label col-sm-3 mg-top-6 ">地址</label>
										<div class="col-sm-8 form-control-static">
											<input id="address" name="address" th:value="*{address}" maxlength="100"
											class="form-control" />
										</div>
									</div>
								</div>
						    </div>
						    <div class="row">
								<div class="col-sm-6">
									<div class="form-group">
										<div class="col-lg-offset-3 col-lg-9 form-control-static" style="margin-left: 25%;">
											<div class="checkbox">
												<input id="enabled" name="enabled" type="checkbox"
												th:checked="*{enabled}" /> <label for="enabled">激活</label>
											</div>
										</div>
									</div>
								</div>
					  	    </div>
					  	    <div class="hr-line-dashed"></div>
							<div class="form-group">
								<div class="text-center">
									<a class="btn btn-default " th:href="@{|${baseUrl}|}"> <i
										class="fa fa-fw fa-reply"></i> 返回
									</a>
									<button type="submit" class="btn btn-primary">
										<i class="fa fa-fw  fa-save"></i> 保存
									</button>
								</div>
							</div>
				</form>
			</div>
		</div>
	</th:block>
	<th:block layout:fragment="scripts">
		<script th:replace="layouts/fragments/validatejs :: validate"></script>
		<script th:inline="javascript">
    	// 后端传入前端使用的变量JS中定义
	    var oldNo = /*[[${m.no}]]*/'';
	    var oldSapPlantNo = /*[[${m.sapPlantNo}]]*/'';
	    var oldName = /*[[${m.name}]]*/'';
    	</script>
		<script th:src="@{|${theme}/js/app/master/plant_form.js?v=${applicationVersion}|}" th:inline="javascript"></script>
	</th:block>
</body>

</html>